import java.util.ArrayList;
import java.util.Collections;

public class Stream {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        ArrayList<String> list1 = new ArrayList<>();
        Collections.addAll(list,"张三","李四","王五","张无忌","张三丰");
        for (String s : list) {
            if(s.startsWith("张")){
                list1.add(s);
            }
        }
        System.out.println(list1);
    }
}
